#include <stdio.h>
int main ()
{
	int i,n,j,k,a[j];
	int max;
	float sum=0,average; 
	scanf ("%d",&n);
	for (i=0;i<n;i++)
	{
		sum=0;
		max=0; 
		scanf ("%d",&k);
		for (j=0;j<k;j++)
		{
			scanf ("%d",&a[j]);
			sum+=a[j];
			if (max>=a[j])
			max=max;
			else
			max=a[j];
		}
		average=sum/k;
		printf ("%d ",max);
		printf ("%f",average);
	}
	printf ("\n");
	return 0;
 } 
